package com.citro.agents;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * Behavior analysis result model
 */
public class BehaviorAnalysisResult implements Serializable {

    private String userId;
    private String sessionId;
    private String contextId;
    private String eventType;
    private Long timestamp;
    private String url;
    private String title;
    private String behaviorType;
    private String behaviorDescription;
    private Double confidence;
    private String analysisMethod;
    private Timestamp createdAt;

    // Default constructor
    public BehaviorAnalysisResult() {
        this.createdAt = new Timestamp(System.currentTimeMillis());
    }

    // Builder pattern for easy construction
    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private BehaviorAnalysisResult result = new BehaviorAnalysisResult();

        public Builder userId(String userId) {
            result.userId = userId;
            return this;
        }

        public Builder sessionId(String sessionId) {
            result.sessionId = sessionId;
            return this;
        }

        public Builder contextId(String contextId) {
            result.contextId = contextId;
            return this;
        }

        public Builder eventType(String eventType) {
            result.eventType = eventType;
            return this;
        }

        public Builder timestamp(Long timestamp) {
            result.timestamp = timestamp;
            return this;
        }

        public Builder url(String url) {
            result.url = url;
            return this;
        }

        public Builder title(String title) {
            result.title = title;
            return this;
        }

        public Builder behaviorType(String behaviorType) {
            result.behaviorType = behaviorType;
            return this;
        }

        public Builder behaviorDescription(String behaviorDescription) {
            result.behaviorDescription = behaviorDescription;
            return this;
        }

        public Builder confidence(Double confidence) {
            result.confidence = confidence;
            return this;
        }

        public Builder analysisMethod(String analysisMethod) {
            result.analysisMethod = analysisMethod;
            return this;
        }

        public BehaviorAnalysisResult build() {
            return result;
        }
    }

    // Getters and Setters
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getContextId() {
        return contextId;
    }

    public void setContextId(String contextId) {
        this.contextId = contextId;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getBehaviorType() {
        return behaviorType;
    }

    public void setBehaviorType(String behaviorType) {
        this.behaviorType = behaviorType;
    }

    public String getBehaviorDescription() {
        return behaviorDescription;
    }

    public void setBehaviorDescription(String behaviorDescription) {
        this.behaviorDescription = behaviorDescription;
    }

    public Double getConfidence() {
        return confidence;
    }

    public void setConfidence(Double confidence) {
        this.confidence = confidence;
    }

    public String getAnalysisMethod() {
        return analysisMethod;
    }

    public void setAnalysisMethod(String analysisMethod) {
        this.analysisMethod = analysisMethod;
    }

    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public String toString() {
        return "BehaviorAnalysisResult{" +
                "sessionId='" + sessionId + '\'' +
                ", behaviorType='" + behaviorType + '\'' +
                ", confidence=" + confidence +
                ", analysisMethod='" + analysisMethod + '\'' +
                '}';
    }
}
